<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="/css/role.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- title -->
<div class="right_title">
  <div class="h">系统模块->添加|编辑系统用户</div>
</div>
<!-- title end -->
<div class="zdgl">

 <form action="/role/su_sysuser.shtml" name="conts" onsubmit="return validate.getSubmit()();">
  <input name="id" value="${user.id}" type="hidden" />

   <div class="line clear">
    <div class="td_left">登录名：</div>
    <div>
      <input type="text" name="user.userName" value="${user.userName}" maxlength="20" class="w_180" onkeyup="this.value=this.value.replace(/[^\w@.\/]/ig,'')" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">昵称：</div>
    <div>
      <input type="text" name="user.nickName" value="${user.nickName}" class="w_180" maxlength="20" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">角色：</div>
    <div>
      <select name="user.roleInfo.roleId" id="position"  style="width:300px;">
        <c:forEach items="${list}" var="role">
          		<option  value="${role.roleId}"   <c:if test="${user.roleInfo.roleId==role.roleId}">selected="selected"</c:if>>${role.roleName}</option>
        </c:forEach>
      </select>
    </div>
  </div>
   <div class="sub clear"><input class="blue_btn" type="submit" name="sm" value="确定">&nbsp;<input class="blue_btn" onclick="come_back();" type="button" name="sm" value="返回列表"> </div>
   <div class="wb_error" style="color:#ff6666;"><s:fielderror><s:param>error</s:param></s:fielderror></div>
   </form>

</div>
</body>
</html>
<script type="text/javascript" src="/scripts/util.js"></script>	
<script type="text/javascript" src="/scripts/east.js"></script>	
<script type="text/javascript" src="/scripts/form_validate.js"></script>
<script type="text/javascript" src="/scripts/mini.js"></script>
<script type="text/javascript">
    validate.addvalidte(document.conts,{
        rules:{
           "user.userName":{checkNull:true},
           "user.nickName":{checkNull:true}
           },
	    message:{
	       contsName:{checkNull:"请输入登录名!"},
	       sort:{checkNull:"请输入昵称!"}
	    },
	    errorPlacement:function(e,m){
	       ep(e,m);
	    },
	    success:function(e){
	        suc(e);
	    }
	    });
	

	function ep(e,m){
	   var tag = e.getAttribute('warn');
	       if(tag!='true'){
	         e.setAttribute('warn','true');
	         var div = util.cElem('label',{className:'error',cssText:'',id:e.name+'_error'},m);
	         insertAfter(div,e);
	       }
	}
	
	function suc(e){
	    var o = util.$(e.name+'_error');
		o && o.parentNode && (o.parentNode.removeChild(o));
		e.setAttribute('warn','false');
	}
	    
	function _submit(th){
      	if(validate.getSubmit()() ){
	       document.conts.submit();
	       th.disabled = "disabled";
	    }
	}
</script>

